package day07;

public class bubbles {
	public static void main(String[] args) {
		int[] arr = new int[]{12,-2,5,123,62,36,-52,0};
		
		for(int i=0;i<arr.length;++i){
			System.out.print(arr[i]+" ");
		}
		System.out.println();
		for(int i = 0;i<arr.length;++i){
			for (int j = 1;j<arr.length-i;j++){
				if (arr[j-1]>arr[j]){
					arr[j-1]^=arr[j];
					arr[j]^=arr[j-1];
					arr[j-1]^=arr[j];
				}
			}
		}
		for(int i=0;i<arr.length;++i){
			System.out.print(arr[i]+" ");
		}
		System.out.println();
	}
}
